package cn.cs.service;

import cn.cs.mapper.ClientBigUserMapper;
import cn.cs.mapper.ComplaintTitleMapper;
import cn.cs.pojo.ClientUser;
import cn.cs.pojo.ComplaintTitle;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class ComplaintTitleService {

    @Resource
    private ComplaintTitleMapper complaintTitleMapper;

    @RequestMapping(value = "/getComplaintTitleById", method = RequestMethod.POST)
    public ComplaintTitle getComplaintTitleById(@RequestParam("id") String id) throws Exception{
        return complaintTitleMapper.getComplaintTitleById(id);
    }

    @RequestMapping(value = "/getComplaintTitleListByMap", method = RequestMethod.POST)
    public List<ComplaintTitle> getComplaintTitleListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return complaintTitleMapper.getComplaintTitleListByMap(param);
    }

    @RequestMapping(value = "/getComplaintTitleCountByMap", method = RequestMethod.POST)
    public Integer getComplaintTitleCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return complaintTitleMapper.getComplaintTitleCountByMap(param);
    }

    @RequestMapping(value = "/addComplaintTitle", method = RequestMethod.POST)
    public Integer addComplaintTitle(@RequestBody ComplaintTitle complaintTitle) throws Exception{
        return complaintTitleMapper.insertComplaintTitle(complaintTitle);
    }

    @RequestMapping(value = "/modifyComplaintTitle", method = RequestMethod.POST)
    public Integer modifyComplaintTitle(@RequestBody ComplaintTitle complaintTitle) throws Exception{
        return complaintTitleMapper.updateComplaintTitle(complaintTitle);
    }

    @RequestMapping(value = "/deleteComplaintTitleById", method = RequestMethod.POST)
    public Integer deleteComplaintTitleById(@RequestParam("id") String id) throws Exception{
        return complaintTitleMapper.deleteComplaintTitleById(id);
    }

}
